<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
    <%  
	String path = request.getContextPath();  
	String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";  
%> 
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<link rel="stylesheet" type="text/css" href="/bsc/static/common/bootstrap/js/bootstrap-3.3.7-dist/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="/bsc/static/common/bootstrap/js/bootstrap-3.3.7-dist/css/bootstrap-theme.min.css">
<script src="/bsc/static/js/jquery-3.1.1.js"></script>
<script src="/bsc/static/common/bootstrap/js/bootstrap-3.3.7-dist/js/bootstrap.min.js"></script>

</head>
<body>
<center>
	<form action="<%=basePath %>Qtbisiness" method="post">
		<table>
			<tr>
				<td>订单编号：</td>
				<td>
					<input type="text" name="order_id" id="order_id" class="form-control" placeholder="请输入订单编号">
				</td>
				<td>顾客姓名：</td>
				<td>
					<input type="text" name="username" id="username" class="form-control" placeholder="请输入顾客姓名">
				</td>
				<td>店铺名称：</td>
				<td> 
					<select name="shop_id" id="shop_id" class="form-control" >
						<option value="-1">请选择</option>
						<c:forEach items="${ listop}" var="s">
							<option value="${s.shop_id }">${s.shop_name }</option>
						</c:forEach>
					</select>
				</td>
				<td>订单来源：</td>
				<td>
					<select name="order_source" id="order_source" class="form-control" >
						<option value="-1">请选择</option>
							<option value="1">平台</option>
							<option value="2">商家</option>
					</select>
				</td>
				<td>
					<input type="submit" value="查询" /> 
					<input type="reset" value="重置" />
				</td>
			</tr>
		</table>
	</form>
	
		<table class="table table-bordered table table-hover">
			<tr>
				<td>订单编号</td>
				<td>顾客账号</td>
				<td>顾客姓名</td>
				<td>消费内容</td>
				<td>价格(元)</td>
				<td>支付方式</td>
				<td>实付金额</td>
				<td>消耗颜值</td>
				<td>店铺编号</td>
				<td>店铺名称</td>
				<td>服务员工</td>
				
				<td>支付时间</td>
				
				<td>订单状态</td>
				<td>订单来源</td>
				<td>操作</td>
			</tr>
			
			<c:forEach items="${list }" var="o">
				<tr>
					<td>${o.order_id }</td> 
					<td>${o.custom_user_id }</td>
					<td>${o.username }</td>
					<td>${o.order_content }</td>
					<td>${o.order_money }</td>
					<td>
						<c:if test="${o.pay_way== 1}">微信</c:if>
						<c:if test="${o.pay_way== 2}">支付宝</c:if>
						<c:if test="${o.pay_way== 3}">美颜币</c:if>
						<c:if test="${o.pay_way== 4}">套餐</c:if>
					</td>
					<td>${o.pay_money }</td>
					<td>${o.extend_beauty_num }</td>
					<td>${o.shop_id }</td>
					<td>${o.shop_name }</td>
					<td>${o.server_user_id }</td>
					
					<td>${o.pay_time }</td>
					
					<td>		
						<c:if test="${o.order_status ==0}">草稿</c:if>
						<c:if test="${o.order_status ==1}">已预约 </c:if>
						<c:if test="${o.order_status ==2}">服务中 </c:if>
						<c:if test="${o.order_status ==3}">待支付</c:if>
						<c:if test="${o.order_status ==4}">已支付 </c:if>
						<c:if test="${o.order_status ==5}">已完成 </c:if>
						<c:if test="${o.order_status ==6}">已过期 </c:if>
						<c:if test="${o.order_status ==7}">已撤销</c:if>
					</td>
					<td>
						<c:if test="${o.order_source ==1}">平台</c:if>
						<c:if test="${o.order_source ==2}">商家</c:if>
					</td>
					<td>
						<button type="button" onclick="orderselectByid(${o.order_id})">查询详情</button>
					</td>
				</tr>
			</c:forEach>
		</table>
	
	
	<!-- Modal -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
  <div class="modal-dialog" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <h4 class="modal-title" id="myModalLabel">Modal title</h4>
      </div>
      <div class="modal-body">
        <table border="0" cellspacing="0" cellpadding="10" width="80%"
			class="table ">
        	<tr>
        		<td>订单编号</td>
        		<td>
        			<input type="text" id="dt_order_id" name="order_id"/>
        		</td>
        	</tr>
        	<tr>
        		<td>顾客姓名</td>
        		<td>
        			<input type="text" id="username" name="username"/>
        		</td>
        	</tr>
        	<tr>
        		<td>消费内容</td>
        		<td>
        			<input type="text" id="dt_order_content" name="order_content"/>
        			
        		</td>
        	</tr>
        	<tr>
        		<td>实付金额</td>
        		<td>
        		 <input type="text" id="pay_money" name="pay_money"/>元
        		</td>
        	</tr>
        	<tr>
        		<td>店铺名称</td>
        		<td>
        			
        			<input type="text" id="dt_shop_name" name="shop_name"/>
        		</td>
        	</tr>
        	
        </table>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
      </div>
    </div>
  </div>
</div>
</center>
</body>
</html>
<script type="text/javascript">
	function orderselectByid(id){
	
	$.ajax({
		type:"post",
		url:"<%=basePath%>orderselectByid",
		data:{'order_id':id},
		dataType:"json",
		success:function(msg){
			$("#dt_order_id").val(msg.order_id);
			$("#username").val(msg.username);
			$("#dt_order_content").val(msg.order_content);
			$("#pay_money").val(msg.pay_money);
			$("#dt_shop_name").val(msg.shop_name);
		}
	})
	$("#myModal").modal("show");
}
	
</script>